<table summary="EE List" id="user_index_table">
  <caption>
    
  </caption>
  <thead>
    <tr>
      <th scope="col">id</th>
      <th scope="col">Cn Name</th>
      <th scope="col">English Name</th>
      <th scope="col">Ext</th>
      <th scope="col">Department</th>
      <th scope="col">Email</th>
      <th scope="col" colspan="2">Action</th>

    </tr>
  </thead>
  <% for user in @users %>
    <tr class="<%= cycle('even','odd') %>">
      <td><%= user.employee_id %></td>
       <td style="text-align:left;padding-left: 15px;">
		<%= image_tag("/images/male.gif",:title =>"male",:alt =>"male",:style => "text-align:left;padding-right: 15px;") if user.gender.downcase == 'male' %>
		<%= image_tag("/images/female.gif",:title =>"female",:alt =>"female",:style => "text-align:left;padding-right: 15px;") if user.gender.downcase == 'female' %>
		<%= link_to user.chinese_name,:action=>'show',:id=>user %></td>
      <td><%= link_to user.english_name,:action=>'show',:id=>user %></td>
      <td><%= user.ext %></td>
      <td><%= user.department.name %></td>
      <td>
			<% if user.email.include?("@") %>
				<a href="mailto:<%= user.email %>"><%= user.email %></a>
			<% else %>
				<a href="mailto:<%= user.email %>@pg.com"><%= user.email %></a>
				<%#= mail_to(user.email+'@pg.com',user.email) %>
			<% end %>
	<%#= mail_to(user.email+'@pg.com',user.email) %></td>
	  <td><%= link_to image_tag("/images/edit2.png",:width => 16,:height => 16,:alt => "Edit?",:title => "Edit?"), {:action => :edit,:id => user} %></td>
	 <td><%= link_to image_tag("/images/delete.gif",:alt => "Delete?",:title => "Delete?"), {:action => :destroy,:id => user,:page => params[:page]},:confirm => "Are you sure you want to delete?",:method => :delete %></td>
    </tr>
  <% end %>
</table>
<br/>
<div id="pageinate">
  <%#= will_paginate @users %>
</div>